Skip to content

Replace local Wire codegen with org.meshtastic:protobufs SDK#50

Draft
jamesarich wants to merge 1 commit into
mainfrom
jamesarich/protobufs-sdk-migration
Draft

Replace local Wire codegen with org.meshtastic:protobufs SDK#50
jamesarich wants to merge 1 commit into
mainfrom
jamesarich/protobufs-sdk-migration

Conversation

@jamesarich
Copy link
Copy Markdown
Collaborator

The sample app currently vendors the protobufs git submodule and runs the Wire Gradle plugin at build time to generate Kotlin models locally. The meshtastic/protobufs repo now publishes a pre-built KMP artifact (org.meshtastic:protobufs) to Maven Central, so consumers no longer need local codegen -- they can depend on the published SDK directly. This aligns MQTTastic-Client-KMP with the same migration done in Meshtastic-Android (meshtastic/Meshtastic-Android#5675) and TAKPacket-SDK (meshtastic/TAKPacket-SDK#42).

Approach

  • Remove the protobufs git submodule and .gitmodules entirely
  • Remove the Wire Gradle plugin from the root and sample build scripts
  • Add org.meshtastic:protobufs:2.7.25-SNAPSHOT as a dependency in the sample's commonMain
  • Add the Sonatype snapshots repository to settings.gradle.kts for SNAPSHOT resolution
  • Remove wire-runtime library and wire plugin entries from the version catalog

Notable trade-offs

  • wasmJs removed from sample: The published protobufs SDK does not yet include a wasmJs target, so the sample app's wasmJs target has been removed. The core library module (the MQTT client itself) is unaffected and still supports wasmJs.
  • SNAPSHOT dependency: Using 2.7.25-SNAPSHOT until a stable release is cut from the protobufs repo. Once published to Maven Central proper, update to the release version.
  • Smart cast fix: MeshPacket.encrypted is now a public property from an external module, so Kotlin can no longer smart-cast it. Wrapped in .let {} to resolve.

… SDK

Replace the protobufs git submodule and local Wire code generation in the
sample app with the published org.meshtastic:protobufs:2.7.25-SNAPSHOT SDK.

Changes:
- Remove protobufs git submodule and .gitmodules
- Remove Wire Gradle plugin from root and sample build scripts
- Add org.meshtastic:protobufs dependency to sample/commonMain
- Add Sonatype snapshots repository for SNAPSHOT resolution
- Remove wasmJs target from sample (SDK does not publish wasmJs yet)
- Fix smart cast issue with MeshPacket.encrypted from external module
- Remove wire-runtime and wire plugin from version catalog

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant